import { $post, $get, $put } from '../utils/request'

// 用户注册
export const STORE_CUSTOMER_REGISTER = params =>
  $post('/store-api/customer/customerRegister', params)

// 用户登录获取token
export const STORE_CUSTOMER_TOKEN = params =>
  $post('/store-api/customer/customerToken', params)

// 用户登录
export const STORE_CUSTOMER_LOGIN = params =>
  $post('/store-api/customer/customerLogin', params)

// 短信发送接口
export const SEND_MESSAGE_STORE = (params, messageTemp) =>
  $post('/store-api/sendMessage', params, { messageTemp })

// 重置会员密码
export const PUT_RESET_MEMBER_PAS = params =>
  $put('/store-api/member/resetMemberPwd', params)

// 查询是否可以开店（1）
export const FIND_SHOP_OPEN_BY_MOBILE = (providerId, cellphone) =>
  $get(
    `/store-api/shop/findShopInfoByCellphone?providerId=${providerId}&cellphone=${cellphone}`
  )

// 查询开店模式（2）
export const FIND_OPEN_SHOP_INFO = params =>
  $post('/store-api/openShop/findOpenShopInfo', params)

// 获取用户customerId开的一个最新店铺的情况（3）
export const FIND_CUSTOMER_SHOP_OPEN_STATE = params =>
  $post('/store-api/shop/getLatestShopInfoByCustomerId', null, params)

// 查询订单
export const FIND_OPEN_SHOP_ORDER_INFO = openShopOrderNo =>
  $get(
    `/store-api/openShop/findOpenShopOrderInfo?openShopOrderNo=${openShopOrderNo}`
  )

// 通过手机号查询用户信息
export const FIND_CUSTOMER_BY_PHONE = (providerId, phone) =>
  $get(
    `/store-api/customer/findCustomerByPhone?providerId=${providerId}&phone=${phone}`
  )
